using System;
using System.Collections.Generic;
using System.Xml.Serialization;

using DC2010.Objects.Base;
using DC2010.Objects.Common;

namespace DC2010.Objects
{
    [Serializable]
    public class CreatureFlags : ICloneable
    {
        /// <summary>
        /// Monster can be dead from its definition. In case of ressurection bones have to be associated.
        /// </summary>
        [XmlAttribute]
        public bool IsDead { get; set; }
		
        /// <summary>
        /// When object is thrown onto creature object is absorbed. For example swampy monster ;)
        /// 
        /// When this bit is set to '1', the creature can absorb some items when they are thrown at the creature (like the Mummy). 
        /// The list of items that can be absorbed is hard coded in the program (Arrow, Slayer, Poison Dart, Throwing Star and Dagger). 
        /// If a thrown item is not absorbed by the creature, it falls on the floor (it is never destroyed).
        /// This is not linked to the ability of the Giggler to steal items in champion hands which is hard coded.
        /// </summary>
        [XmlAttribute]
        public bool IsAbsorbingItems { get; set; }

        [XmlAttribute]
        public bool IsInvincible { get; set; }


        /// <summary>
        /// This means that creature can be hit only by certain items.
        /// If this bit is set to '1', the creature is non material. 
        /// These creatures ignore normal attacks but take damage from the 'Disrupt' action of the Vorpal Blade. 
        /// Fire damage is also reduced by a half. All missiles except 'Weaken Non-material Beings' pass through these creatures 
        /// (this is hard coded). These creatures can pass through all doors of any type.
        /// </summary>
        [XmlAttribute]
        public bool IsNonMaterial { get; set; }

        /// <summary>
        /// If this bit is set to '1', the creature can pass over pits without falling.
        /// </summary>
        [XmlAttribute]
        public bool IsLevitating { get; set; }

        /// <summary>
        /// If this bit is set to '1', the creature will drop some items when it is killed.
        /// </summary>
        [XmlAttribute]
        public bool IsDroppingItems { get; set; }

        /// <summary>
        /// When this bit is set to '1', the creature can see the party in darkness because
        /// it ignores the sight range reduction caused by low light levels in the dungeon.
        /// </summary>
        [XmlAttribute]
        public bool IsNightvisioner { get; set; }	

		public CreatureFlags()
		{
			IsDead = false;
			IsAbsorbingItems = false;
			IsInvincible = false;
			IsNonMaterial = false;
			IsLevitating = false;
			IsNightvisioner = false;
			
			IsDroppingItems = true;
		}
		
        public object Clone()
        {
            return this.MemberwiseClone();
        }
	}
}